package com.yunsc.shop.config;

import com.yunsc.common.properties.MinioProperties;
import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-01-26 14:02
 */

@Configuration
public class MinioConfig {


    @Bean
    public MinioClient minioClient(MinioProperties minioProperties) {
        return MinioClient.builder().
                endpoint(minioProperties.getEndpoint()).
                credentials(minioProperties.getAccessKey(), minioProperties.getSecretKey()).
                build();
    }
}
